Internal Error when adding Content management

by: prithvirajkadiyala, 8 years ago

Last edited: 8 years ago

Everytime i try to enter the content management code and run the site gives me 500 internal error
I dont know what is the problem

__init__.py code

from flask import Flask, render_template, url_for
from content_management import Content

TOPIC_DICT = Content()

app = Flask(__name__)

@app.route('/')
def homepage():
return render_template("index.html")

@app.route('/dashboard/')
def dashboard():
return render_template("dashboard.html", TOPIC_DICT = TOPIC_DICT)

if __name__ == "__main__":
    app.run()




content_management code

def Content():
TOPIC_DICT = {"Basics":[["Introduction to Python", "/introduction-to-python-programming/"]
                                ["Print Functions and strings", "/python-tutorial-print-function-strings/"]]
                      "Web Development":[]}
return TOPIC_DICT




You must be logged in to post. Please login or register an account.



try from .content_management import Content  (relative import).  Also if you have any 500 errors, always check your apache error.log which will tell you exactly what went wrong.  Remember this content management module is customized and maybe not ideal for your website purposes.  I skipped it initially because it didnt fully suit my website.

-kingfitz 8 years ago

You must be logged in to post. Please login or register an account.